<?
/* @author Udo Schroeter <udo.schroeter@gmail.com>
 * @license dual license: LGPL / commercial use license
 */ 

global $charZone, $ctrObj;
$charZone = DB_GetDataset('zones', $ctrObj->character->charDS['c_location']);

function DisplayCharacterList($list, $linkText = '', $linkUrl = '', $linkfield = 'c_key')
{
global $config, $charZone;
?><table><?
  
if (!is_array($list)) $list = array();

foreach($list as $member)
{
$pic = getDefault($member['u_fb_pic_square'], $config['friend.stdimage']);
if ($member['p_type'] == 'mob') $pic = 'img/'.$member['c_icon'].'.png';
?><tr>
  <td valign="top"><img width="50" src="<?= $pic ?>"/>&nbsp;&nbsp;&nbsp;</td>
  <td valign="top">
    <b><? if ($member['p_type'] != 'mob' && $member['c_key'] > 0) { ?>
    <a href="<?= actionUrl('view', 'character', 'id='.$member['c_key']) ?>">
    <? } ?><?= getDefault($member['c_name'], $member['u_fb_name']) ?></a></b><?
    if ($member['c_level'] > 0)
      print(', level '.$member['c_level']);
    ?> <br/>
    <?
    if ($member['p_type'] == 'mob')
      print($charZone['z_name']);
    else
      print($member['z_name']); ?><?
    if ($linkText != '')
      print('<div style="padding-top: 3px"><a class="linkbutton" href="'.$linkUrl.$member[$linkfield].'">'.$linkText.'</a></div>');
    ?>
  </td>
</tr><?
}

?></table><?
}

?>